package com.shangjun;

import java.util.Scanner;

/**
 * Created by sahngjun on 2017/3/23.
 */
public class Main01 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()) {
            String oldNum = scanner.nextLine();
            String result = "NO";
            Boolean bool = IsThatNum(oldNum);
            if (bool == true) {
                result = "YES";
            }
            System.out.println(result);
        }
    }
    public static boolean IsThatNum(String oldNum){
        Boolean bool=false;
        String[] stringArray=oldNum.split("");
        int[] intArray=new int[stringArray.length];
        for (int i=0;i<stringArray.length;i++){
            intArray[i] = Integer.parseInt(stringArray[i]);
        }
        for (int p = 0;p<intArray.length-1;p++){
            int a=1,b=1;
            int k = p;
            int m = p+1;
            while(k>=0){
                a = a*intArray[k];
                k--;
            }
            while(m<intArray.length){
                b=b*intArray[m];
                m++;
            }
            if(a==b){
                bool = true;
                break;
            }
        }

        return bool;
    }
}

